<template>
  <el-dropdown
    trigger="hover"
    @command="hanldeUserCenter"
    :show-timeout="0"
    class="mx15 cP"
  >
  <el-icon
        :style="{
          color:navIsTo
            ? 'var(--menuColorFont)'
            : 'var(--navColorFont)',
        }"
      
        class="llt-icon-size"
        ><iconLanguage
      /></el-icon>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item
        v-for="item in messages" :key="item.value"
         :command="item.value" 
          >{{item.name}}</el-dropdown-item
        >
       
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</template>

<script setup lang="ts">
import { ref, reactive, computed, onMounted } from "vue";
import { useRouter } from "vue-router";
import { routerPush } from "/@ts/hooks/route";
import { useIndexStore } from "/@ts/store";
import {messages} from '/@ts/language/index'
import {language} from '/@ts/language/index.d'
import { setLocalStorage } from "/@ts/hooks/storage";
const router = useRouter();
const store = useIndexStore();
const navIsTo = computed(() => store.getNavIsTo);
const activeIndex = ref(0);
const state = reactive({
  userInfo: {},
});
onMounted(() => {});

//用户头像菜单
const hanldeUserCenter = (e: string) => {
  setLocalStorage(language, e);
  location.reload();
};
const handleSelect = () => {};
defineProps({

});
</script>

<style scoped lang="scss">

</style>
